package com.ruoyi.api.kehu;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IJiajiaUserService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotEmpty;

@RestController
@RequestMapping("/api/kehu/wxQRCode")
@Api(tags = "微信二维码")
public class ApiWxQRCodeController {
    @Resource
    private IJiajiaUserService userService;
    private static final Logger log = LoggerFactory.getLogger(ApiWxQRCodeController.class);

    /**
     * 生成二维码
     */
    @Operation(summary = "生成二维码")
    @GetMapping("/qRCode")
    public AjaxResult qRCode(@NotEmpty String phone , @NotEmpty String page) {
        log.info("生成二维码phone:"+phone+"page:"+page);
        AjaxResult r = userService.postMiniqrQr(phone,page);
        return r;
    }

}
